import React, { Component } from 'react'

export class Son extends Component {
    gotoParent(){
        console.log(this.props);
        const data = ["1908c","帅哥","美女"]
        this.props.parent(data)
    }
    render() {
        // console.log(this.props);
        let {list} = this.props
        return (
            <div className="Son">
                hi 我是子组件
                {
                    list.map((item,index)=>{
                        return <p key={index}>{item}</p>
                    })
                }
                <button onClick={this.gotoParent.bind(this)}>点我子传父</button>
            </div>
        )
    }
}

export default Son
